import request from '@/utils/request'

// 获取数据源模型
export function getDatasource(params) {
  return request({
    url: '/online/flycare/chart/datasource',
    method: 'get',
    params
  })
}

// 获取数据源模型明细
export function getDatasourceMode(params) {
  return request({
    url: '/online/flycare/chart/datasource/mode',
    method: 'get',
    params
  })
}

// 获取动态饼图数据
export function getPieChartData(data) {
  return request({
    url: '/online/flycare/chart/dynamic/pie/data',
    method: 'post',
    data
  })
}

// 获取动态图形数据
export function getChartData(data) {
  return request({
    url: '/online/flycare/chart/dynamic/data',
    method: 'post',
    data
  })
}

// 获取动态表格数据
export function getTableData(data) {
  return request({
    url: '/online/flycare/chart/table/dynamic/data',
    method: 'post',
    data
  })
}

// 新增图形模型
export function addChartMode(data) {
  return request({
    url: '/online/flycare/chart/mode',
    method: 'post',
    data
  })
}

// 查询图形模型
export function findChartMode(params) {
  return request({
    url: '/online/flycare/chart/mode',
    method: 'get',
    params
  })
}

// 删除图形模型
export function deleteChartMode(data) {
  return request({
    url: '/online/flycare/chart/delete/chart',
    method: 'post',
    data
  })
}

// 更新图形模型
export function updateChartMode(data) {
  return request({
    url: '/online/flycare/chart/update/chart',
    method: 'post',
    data
  })
}

